﻿using System;
using System.Diagnostics;
using Autodesk.Revit.Attributes;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using YJKCodeBase.WinForm;

namespace FetchDataCompare
{
	[Transaction(TransactionMode.Manual)]
	public class CmdFetchDataCompare : IExternalCommand
	{
		public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
		{
			Process currentProcess = Process.GetCurrentProcess();
			IntPtr mainWindowHandle = currentProcess.MainWindowHandle;
			this._hWndRevit = new WindowHandle(mainWindowHandle);
			FetchManager fetchManager = new FetchManager(commandData, this._hWndRevit);
			fetchManager.DoCompare();
			return Autodesk.Revit.UI.Result.Succeeded;
		}

		private WindowHandle _hWndRevit;
	}
}
